Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add align commands (left, center, right) #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

osv
Copy link

@osv osv commented Oct 11, 2024

Added ^left(), ^center(), and ^right() commands.
With these commands, there's no longer a need to run multiple instances of dzen2 or use the -expand parameter.

Each new command will copy pixmap to window and call parse_line with rest of not processed text.

Demo:

window

#!/usr/bin/env bash

# nano dark theme
FOREGROUND="#ECEFF4"  # white
BACKGROUND="#2E3440"  # black
HIGHLIGHT="#3B4252"   # brightblack
SUBTLE="#434C5E"      # brightblack
FADED="#677691"       # cyan
SALIENT="#81A1C1"     # brightblue
STRONG="#FFFFFF"      # brightwhite
POPOUT="#D08770"      # brightred
CRITICAL="#EBCB8B"    # yellow


fg="^fg($FOREGROUND)"
bg="^fg($BACKGROUND)"
sep="^fg($FADED)|"
active="^bg($POPOUT)^fg($BACKGROUND)"

key="^fg($SALIENT)"
val="^fg($STRONG)"

left="^left()${bg}$fg 1 $sep $fg 2 $sep $active 3 "
center="^center()${fg}12:34"
right="^right()$key CPU:$val 10% $sep $key MEM:$val 3.3GB"

echo " ${left}${center}${right} " | ./dzen2 -p -fn "Iosevka Comfy-12" -w 800 -bg $BACKGROUND -fg $FOREGROUND

My fork includes graphical unit tests, and no regressions have been detected.

@osv osv changed the title Add align commands (left, center, right_ Add align commands (left, center, right) Oct 11, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant